<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>头部信息</title>
	<style type="text/css">
	#header{
		text-decoration: none;
	}
	#headerh1{
		text-decoration: none;
		color: #E6E6FA;
		font-family: 微软雅黑；
		font-size:33px;
	}
	#header{
		background-color: #383D49;
		color: white;
		text-align: center;
		height: 70px;
	}
	#headerleft{
		float: left;
		height: 50px;
		color: #E6E6FA;
		line-height: 20px;
		position: absolute;
		left: 2%;
	}
	#headerleft h1 {
		margin-right: 14px;
		display: inline-block;
	}
	#headerright{
		float: right;
		height: 60px;
		text-align: center;
		line-height: 70px;
	}
	#headerright a{
		color: red;
	}
	</style>
</head>
<body>
<div id="header">
	<div id="headerleft">
		<h1><a href="index.php" id="headerh1">SUPPER课程表<a/></h1>
		<span><?php date_default_timezone_set("Asia/Shanghai");
		echo date('Y-m-d-l') ?></span>
	</div>
	<div id="headerright">
	<?php
//判断cookie从而确定当前是否有用户登录 以及登录用户的名字
//$_COOKIE数组来判断
if(isset($_COOKIE["username"])&&$_COOKIE["username"]!=NULL){
	$username=$_COOKIE["username"];
	echo "<div class='hea2' style='float:right; '><a style='text-decoration: none;' href=\"logout.php?action=logout\"><button>点击退出</button></a><br/></div>";
	echo "<div class='hea2' style='float:right;'>欢迎您！".$username."&nbsp;</div>";
}else{
//未登录用户欢迎登录
//echo "<div id=header1><h1>未登录用户欢迎登录</h1></div>";
		echo "<div style='float:right'>
		<a>欢迎您</a>
		&nbsp&nbsp&nbsp
		<a href=\"Registration.php\">注册</a>
		&nbsp&nbsp&nbsp
		<a href=\"login.php\">登录</a>
		&nbsp&nbsp&nbsp
			</div>";
	 }	 
	?>

	</div>
</div>
</body>
</html>
